<html>
<head><meta charset="utf-8"><title>hygiene-opt-out · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html">hygiene-opt-out</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="132487528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132487528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132487528">(Aug 20 2018 at 23:31)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> Hey. Let me know when you're around for a brief chat.</p>



<a name="132487951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132487951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132487951">(Aug 20 2018 at 23:42)</a>:</h4>
<p>I'm here.</p>



<a name="132487975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132487975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132487975">(Aug 20 2018 at 23:44)</a>:</h4>
<p>If you want some comment regarding <a href="https://github.com/rust-lang/rfcs/pull/2498" target="_blank" title="https://github.com/rust-lang/rfcs/pull/2498">https://github.com/rust-lang/rfcs/pull/2498</a>, then I don't know what to say.</p>



<a name="132488017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488017">(Aug 20 2018 at 23:44)</a>:</h4>
<p>Hi. So... I was just chatting with @nrc about expanding the proc macro API to allow the creation of <code>hyg_lift</code> and <code>hyg_swap</code> proc macros.</p>



<a name="132488021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488021">(Aug 20 2018 at 23:44)</a>:</h4>
<p>The comment section looks like a bunch of people talking past each other.</p>



<a name="132488035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488035">(Aug 20 2018 at 23:45)</a>:</h4>
<p>Apart from tmcombs coming in from the cold, I don't think so really.</p>



<a name="132488039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488039">(Aug 20 2018 at 23:45)</a>:</h4>
<p>Proc macro API already provides all possible operations to get and set spans and split them into location and hygiene data.</p>



<a name="132488046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488046">(Aug 20 2018 at 23:45)</a>:</h4>
<p>Just @nrc proposed a new approach (different from what I wrote up) and I agreed it made sense</p>



<a name="132488049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488049">(Aug 20 2018 at 23:45)</a>:</h4>
<p>I see</p>



<a name="132488057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488057">(Aug 20 2018 at 23:45)</a>:</h4>
<p>@nrc Was thinking of a more abstract proc macro API for hygiene but I'm open...</p>



<a name="132488099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488099">(Aug 20 2018 at 23:46)</a>:</h4>
<p>But that RFC is not about proc macros at all.</p>



<a name="132488107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488107">(Aug 20 2018 at 23:46)</a>:</h4>
<p>No, it's not.</p>



<a name="132488113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488113">(Aug 20 2018 at 23:46)</a>:</h4>
<p>But the idea is to solve the problem of hygiene opt-out.</p>



<a name="132488133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488133">(Aug 20 2018 at 23:47)</a>:</h4>
<p>Proc macros can do any operations, but proc-macros are a big gun that shouldn't be pulled on every occasion.</p>



<a name="132488134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488134">(Aug 20 2018 at 23:47)</a>:</h4>
<p>And I concur with @nrc that the best way to do it is just to expand the proc macro API</p>



<a name="132488140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488140">(Aug 20 2018 at 23:47)</a>:</h4>
<p>For proc macros hygiene opt-out is a solved problem, it was just stabilized in the previous release.</p>



<a name="132488142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488142">(Aug 20 2018 at 23:47)</a>:</h4>
<p>Hmm... so you prefer the existing approach, more or less?</p>



<a name="132488184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488184">(Aug 20 2018 at 23:48)</a>:</h4>
<p>(yes, but I mean using proc macros within declarative macros for the purpose of hygiene opt-out)</p>



<a name="132488191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488191">(Aug 20 2018 at 23:48)</a>:</h4>
<p>from the user-perspective they're the same. macros are macros, when you use them.</p>



<a name="132488192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488192">(Aug 20 2018 at 23:48)</a>:</h4>
<p>Decl macros just need some syntax for it usable in common case so that proc macros are not commonly necessary.</p>



<a name="132488222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488222">(Aug 20 2018 at 23:49)</a>:</h4>
<p>but that's what @nrc is saying I guess: why not make use of proc macros for that hygiene opt-out syntax?</p>



<a name="132488232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488232">(Aug 20 2018 at 23:49)</a>:</h4>
<p>Why?</p>



<a name="132488236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488236">(Aug 20 2018 at 23:49)</a>:</h4>
<p>To get some horrible macro invocation syntax instead of just #ident?</p>



<a name="132488284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488284">(Aug 20 2018 at 23:50)</a>:</h4>
<p>heh</p>



<a name="132488292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488292">(Aug 20 2018 at 23:50)</a>:</h4>
<p>I know what you mean... the question is, how common will this be?</p>



<a name="132488305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488305">(Aug 20 2018 at 23:50)</a>:</h4>
<p>Also, what about the case when one wants to set the syntax context of one token to that of another token?</p>



<a name="132488323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488323">(Aug 20 2018 at 23:51)</a>:</h4>
<blockquote>
<p>Also, what about the case when one wants to set the syntax context of one token to that of another token?</p>
</blockquote>
<p>Proc macros</p>



<a name="132488331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488331">(Aug 20 2018 at 23:51)</a>:</h4>
<p>Okay, so you agree to proc macros there...</p>



<a name="132488332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488332">(Aug 20 2018 at 23:51)</a>:</h4>
<p>hmm</p>



<a name="132488336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488336">(Aug 20 2018 at 23:51)</a>:</h4>
<p>I feel like I'm the man-in-the-middle between you and nrc now, hah.</p>



<a name="132488395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488395">(Aug 20 2018 at 23:52)</a>:</h4>
<p>So to be clear... can one already implement opt-out syntax as a proc macro? e.g. <code>lift!(...)</code>?</p>



<a name="132488401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488401">(Aug 20 2018 at 23:52)</a>:</h4>
<p>is it possible to get the <code>SyntaxContext</code> of expansions, up the chain?</p>



<a name="132488418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488418">(Aug 20 2018 at 23:53)</a>:</h4>
<p>Could you describe what <code>lift!(...)</code> does?</p>



<a name="132488426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488426">(Aug 20 2018 at 23:53)</a>:</h4>
<p>What arguments it takes and what it returns.</p>



<a name="132488497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488497">(Aug 20 2018 at 23:55)</a>:</h4>
<p>Just an arbitrary token stream, and it returns the same token stream but with its syntax context changed to that of the the call-site (i.e. outside of the current expansion) relative to where it is used/invoked.</p>



<a name="132488599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488599">(Aug 20 2018 at 23:57)</a>:</h4>
<p>Yes, sure this can be implemented as a procedural macro.</p>



<a name="132488651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488651">(Aug 20 2018 at 23:58)</a>:</h4>
<p>Or as a built-in syntactic extension if it needs to live in the standard library.</p>



<a name="132488760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488760">(Aug 21 2018 at 00:01)</a>:</h4>
<p>I don't think it will be convenient to use in the common case though.</p>



<a name="132488778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488778">(Aug 21 2018 at 00:01)</a>:</h4>
<p>Yeah. I mentioned to @nrc that the stdlib approach might be better... is the syntax extension API different to the proc macro API? Is that the "raw" interface to rustc?</p>



<a name="132488779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488779">(Aug 21 2018 at 00:01)</a>:</h4>
<p>Say, you need to generate a struct visible from outside of the macro <code>struct #S;</code></p>



<a name="132488780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488780">(Aug 21 2018 at 00:01)</a>:</h4>
<p>inconvenient because it's too verbose?</p>



<a name="132488830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488830">(Aug 21 2018 at 00:02)</a>:</h4>
<p>Then you can't write <code>struct lift!(S);</code> because macro invocations are not allowed in arbitrary identifier positions.</p>



<a name="132488843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488843">(Aug 21 2018 at 00:02)</a>:</h4>
<p>They're not allowed in arbitrary identifier positions because it creates parsing difficulties, or what?</p>



<a name="132488952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488952">(Aug 21 2018 at 00:05)</a>:</h4>
<p>This is an interesting question, but I can't answer it right now.<br>
They certainly make parsing more complex, but I'm not sure how much more complex.</p>



<a name="132488965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132488965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132488965">(Aug 21 2018 at 00:05)</a>:</h4>
<p>There was an old RFC about this, IIRC.</p>



<a name="132489557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132489557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132489557">(Aug 21 2018 at 00:21)</a>:</h4>
<p>yeah, looking at it now hmm</p>



<a name="132489602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132489602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132489602">(Aug 21 2018 at 00:22)</a>:</h4>
<p>seems the concerns were mainly about a) macro-names being defined by expansions of other macros, b) readability.</p>



<a name="132489604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/hygiene-opt-out/near/132489604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/hygiene-opt-out.html#132489604">(Aug 21 2018 at 00:22)</a>:</h4>
<p>I could be mistaken though</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>